package com.zx.sdk.model;

import com.google.gson.annotations.SerializedName;
import com.zx.sdk.ZxSDK;

import java.util.Objects;

public class AdInfo {
    public static int AD_TYPE_BANNER_AD = 3;
    public static int AD_TYPE_SUSPENSION = 5;
    public static int AD_TYPE_EXPRESS_INTERSTITIAL_AD = 2;
    public static int AD_TYPE_REWARD_VIDEO_AD = 1;
    private String pid;
    private String uid;
    private String display;
    private String token;

    public int getAdType() {
        return adType;
    }

    public void setAdType(int adType) {
        this.adType = adType;
    }

    private int adType;
    private String extend;
    /**
     * ground | bidding | target
     */
    @SerializedName("type")
    private String billType;
    private String league = "null";
    private String mapAppid;
    @SerializedName("targetPrice")
    private int cpm;
    private String mapPid;
    private int weight;

    public String getPID() {
        return pid;
    }


    public String getDisplay() {
        return display;
    }


    public String getLeague() {
        return league;
    }


    public String getMapAppid() {
        return mapAppid;
    }


    public String getMapPid() {
        return mapPid;
    }


    public int getWeight() {
        return weight;
    }


    public String getBillType() {
        return billType;
    }

    public boolean isBiddingPosition() {
        return ZxSDK.Bidding.equals(billType);
    }

    public void setCpm(int cpm) {
        this.cpm = cpm;
    }

    public int getCpm() {
        return cpm;
    }

    public String getExtend() {
        return extend;
    }

    public void setExtend(String extend) {
        this.extend = extend;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AdInfo adInfo = (AdInfo) o;
        return league.equals(adInfo.league) && mapAppid.equals(adInfo.mapAppid) && mapPid.equals(adInfo.mapPid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(league, mapAppid, mapPid);
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getToken() {
        return token;
    }
}
